﻿using EFModel;
using IServices;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using xm.Controllers;
using Y2.Dao;
using Y2.Filters;

namespace Y2.Controllers
{
    [LoginFilter]
    public class config_file_first_kindController : Controller
    {
        private readonly Iconfig_file_first_kind he;

        public config_file_first_kindController(Iconfig_file_first_kind he)
        {
            this.he = he;
        }
        public IActionResult config_file_first_kind()
        {
            return View();
        }

        public async Task<IActionResult> Index3(int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.Index3(currentPage, pageSize)));
        }
       [HttpPost]
        public async Task<int> Inser(string first_kind_id, string first_kind_name, string first_kind_salary_id, string first_kind_sale_id)
        {
            return await he.Inser(first_kind_id, first_kind_name, first_kind_salary_id, first_kind_sale_id);
        }

        public async Task<int> Updat(string first_kind_id, string first_kind_name, string first_kind_salary_id, string first_kind_sale_id, int ffk_id)
        {
            return await he.Updat(first_kind_id, first_kind_name, first_kind_salary_id, first_kind_sale_id, ffk_id);
        }

        public async Task<int> delt(int ffk_id)
        {
            return await he.delt(ffk_id);
        }
    }
}
